<!DOCTYPE html>





<html class="theme-next muse use-motion" lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="generator" content="Hexo 3.9.0">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.3.0">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.3.0">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.3.0">
  <link rel="mask-icon" href="/images/logo.svg?v=7.3.0" color="#222">

<link rel="stylesheet" href="/css/main.css?v=7.3.0">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '7.3.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    save_scroll: false,
    copycode: {"enable":false,"show_result":false,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="wireshark插件开发之vsomeip协议XuQi 2019/07/08 Lua语法介绍Lua 是一种轻量小巧的脚本语言，用标准C语言编写并以源代码形式开放， 其设计目的是为了嵌入应用程序中，从而为应用程序提供灵活的扩展和定制功能。 Lua 数据类型Lua 中有 8 个基本类型分别为：nil、boolean、number、string、userdata、function、thread 和 ta">
<meta name="keywords" content="wireshark,vsomeip,lua">
<meta property="og:type" content="article">
<meta property="og:title" content="wireshark插件开发之vsomeip协议">
<meta property="og:url" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/index.html">
<meta property="og:site_name" content="XuQi&#39;s Blog">
<meta property="og:description" content="wireshark插件开发之vsomeip协议XuQi 2019/07/08 Lua语法介绍Lua 是一种轻量小巧的脚本语言，用标准C语言编写并以源代码形式开放， 其设计目的是为了嵌入应用程序中，从而为应用程序提供灵活的扩展和定制功能。 Lua 数据类型Lua 中有 8 个基本类型分别为：nil、boolean、number、string、userdata、function、thread 和 ta">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562299432958.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562299029209.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562298780881.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562300682790.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562300743413.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562293564841.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562293578821.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562293734094.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562293950521.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562297940288.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562302859400.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562303216672.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562303573720.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562315812364.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562546595082.png">
<meta property="og:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562546622875.png">
<meta property="og:updated_time" content="2019-10-20T13:23:23.049Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="wireshark插件开发之vsomeip协议">
<meta name="twitter:description" content="wireshark插件开发之vsomeip协议XuQi 2019/07/08 Lua语法介绍Lua 是一种轻量小巧的脚本语言，用标准C语言编写并以源代码形式开放， 其设计目的是为了嵌入应用程序中，从而为应用程序提供灵活的扩展和定制功能。 Lua 数据类型Lua 中有 8 个基本类型分别为：nil、boolean、number、string、userdata、function、thread 和 ta">
<meta name="twitter:image" content="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/1562299432958.png">
  <link rel="canonical" href="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true,
    isPage: false,
    isArchive: false
  };
</script>

  <title>wireshark插件开发之vsomeip协议 | XuQi's Blog</title>
  








  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  <div class="container sidebar-position-left">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">XuQi's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
      
      
      
        
        <li class="menu-item menu-item-home">
      
    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-archives">
      
    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
  </ul>

    

</nav>
</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content page-post-detail">
            

  <div id="posts" class="posts-expand">
    

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/07/05/wireshark插件开发之vsomeip协议/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="XuQi">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="XuQi's Blog">
    </span>
      <header class="post-header">

        
          <h1 class="post-title" itemprop="name headline">wireshark插件开发之vsomeip协议

            
          </h1>
        

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              
                
              

              <time title="创建时间：2019-07-05 10:08:24" itemprop="dateCreated datePublished" datetime="2019-07-05T10:08:24+00:00">2019-07-05</time>
            </span>
          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2019-10-20 13:23:23" itemprop="dateModified" datetime="2019-10-20T13:23:23+00:00">2019-10-20</time>
              </span>
            
          

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="wireshark插件开发之vsomeip协议"><a href="#wireshark插件开发之vsomeip协议" class="headerlink" title="wireshark插件开发之vsomeip协议"></a>wireshark插件开发之vsomeip协议</h2><p><strong><em>XuQi 2019/07/08</em></strong></p>
<h4 id="Lua语法介绍"><a href="#Lua语法介绍" class="headerlink" title="Lua语法介绍"></a>Lua语法介绍</h4><p>Lua 是一种轻量小巧的脚本语言，用标准C语言编写并以源代码形式开放， 其设计目的是为了嵌入应用程序中，从而为应用程序提供灵活的扩展和定制功能。</p>
<h5 id="Lua-数据类型"><a href="#Lua-数据类型" class="headerlink" title="Lua 数据类型"></a>Lua 数据类型</h5><p>Lua 中有 8 个基本类型分别为：nil、boolean、number、string、userdata、function、thread 和 table。</p>
<table>
<thead>
<tr>
<th align="left">数据类型</th>
<th align="left">描述</th>
</tr>
</thead>
<tbody><tr>
<td align="left">nil</td>
<td align="left">这个最简单，只有值nil属于该类，表示一个无效值（在条件表达式中相当于false）。</td>
</tr>
<tr>
<td align="left">userdata</td>
<td align="left">表示任意存储在变量中的C数据结构</td>
</tr>
<tr>
<td align="left">table</td>
<td align="left">Lua 中的表（table）其实是一个”关联数组”（associative arrays），数组的索引可以是数字、字符串或表类型。在 Lua 里，table 的创建是通过”构造表达式”来完成，最简单构造表达式是{}，用来创建一个空表。</td>
</tr>
</tbody></table>
<a id="more"></a>

<h5 id="Lua-变量"><a href="#Lua-变量" class="headerlink" title="Lua 变量"></a>Lua 变量</h5><h6 id="单行注释"><a href="#单行注释" class="headerlink" title="单行注释"></a>单行注释</h6><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">--</span></span><br></pre></td></tr></table></figure>

<h6 id="多行注释"><a href="#多行注释" class="headerlink" title="多行注释"></a>多行注释</h6><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">--[[</span></span><br><span class="line"><span class="comment"> 多行注释</span></span><br><span class="line"><span class="comment"> 多行注释</span></span><br><span class="line"><span class="comment"> --]]</span></span><br></pre></td></tr></table></figure>

<h6 id="变量定义和赋值"><a href="#变量定义和赋值" class="headerlink" title="变量定义和赋值"></a>变量定义和赋值</h6><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">a = <span class="number">5</span>               <span class="comment">-- 全局变量</span></span><br><span class="line"><span class="keyword">local</span> b = <span class="number">5</span>         <span class="comment">-- 局部变量</span></span><br><span class="line"></span><br><span class="line">a = <span class="string">"hello"</span> .. <span class="string">"world"</span></span><br><span class="line">t.n = t.n + <span class="number">1</span></span><br></pre></td></tr></table></figure>

<h5 id="Lua循环"><a href="#Lua循环" class="headerlink" title="Lua循环"></a>Lua循环</h5><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">while</span>( <span class="literal">true</span> )</span><br><span class="line"><span class="keyword">do</span></span><br><span class="line">   <span class="built_in">print</span>(<span class="string">"循环将永远执行下去"</span>)</span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<h5 id="Lua-流程控制"><a href="#Lua-流程控制" class="headerlink" title="Lua 流程控制"></a>Lua 流程控制</h5><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">--[ 0 为 true ] 控制结构的条件表达式结果可以是任何值，Lua认为false和nil为假，true和非nil为真。</span></span><br><span class="line"><span class="keyword">if</span>(<span class="number">0</span>)</span><br><span class="line"><span class="keyword">then</span></span><br><span class="line">    <span class="built_in">print</span>(<span class="string">"0 为 true"</span>)</span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<h5 id="Lua-函数"><a href="#Lua-函数" class="headerlink" title="Lua 函数"></a>Lua 函数</h5><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">myprint = <span class="function"><span class="keyword">function</span><span class="params">(param)</span></span></span><br><span class="line">   <span class="built_in">print</span>(<span class="string">"这是打印函数 -   ##"</span>,param,<span class="string">"##"</span>)</span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">add</span><span class="params">(num1,num2,functionPrint)</span></span></span><br><span class="line">   result = num1 + num2</span><br><span class="line">   <span class="comment">-- 调用传递的函数参数</span></span><br><span class="line">   functionPrint(result)</span><br><span class="line"><span class="keyword">end</span></span><br><span class="line">myprint(<span class="number">10</span>)</span><br><span class="line"><span class="comment">-- myprint 函数作为参数传递</span></span><br><span class="line">add(<span class="number">2</span>,<span class="number">5</span>,myprint)</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 可变参数</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">add</span><span class="params">(...)</span></span>  </span><br><span class="line"><span class="keyword">local</span> s = <span class="number">0</span>  </span><br><span class="line">  <span class="keyword">for</span> i, v <span class="keyword">in</span> <span class="built_in">ipairs</span>&#123;...&#125; <span class="keyword">do</span>   <span class="comment">--&gt; &#123;...&#125; 表示一个由所有变长参数构成的数组  </span></span><br><span class="line">    s = s + v  </span><br><span class="line">  <span class="keyword">end</span>  </span><br><span class="line">  <span class="keyword">return</span> s  </span><br><span class="line"><span class="keyword">end</span>  </span><br><span class="line"><span class="built_in">print</span>(add(<span class="number">3</span>,<span class="number">4</span>,<span class="number">5</span>,<span class="number">6</span>,<span class="number">7</span>))  <span class="comment">---&gt;25</span></span><br><span class="line"></span><br><span class="line"><span class="comment">--多返回值</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">maximum</span> <span class="params">(a)</span></span></span><br><span class="line">    <span class="keyword">local</span> mi = <span class="number">1</span>             <span class="comment">-- 最大值索引</span></span><br><span class="line">    <span class="keyword">local</span> m = a[mi]          <span class="comment">-- 最大值</span></span><br><span class="line">    <span class="keyword">for</span> i,val <span class="keyword">in</span> <span class="built_in">ipairs</span>(a) <span class="keyword">do</span></span><br><span class="line">       <span class="keyword">if</span> val &gt; m <span class="keyword">then</span></span><br><span class="line">           mi = i</span><br><span class="line">           m = val</span><br><span class="line">       <span class="keyword">end</span></span><br><span class="line">    <span class="keyword">end</span></span><br><span class="line">    <span class="keyword">return</span> m, mi</span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">print</span>(maximum(&#123;<span class="number">8</span>,<span class="number">10</span>,<span class="number">23</span>,<span class="number">12</span>,<span class="number">5</span>&#125;))</span><br></pre></td></tr></table></figure>

<h5 id="Lua-字符串"><a href="#Lua-字符串" class="headerlink" title="Lua 字符串"></a>Lua 字符串</h5><ul>
<li><p>单引号间的一串字符。</p>
</li>
<li><p>双引号间的一串字符。</p>
</li>
<li><p>[[和]]间的一串字符。</p>
</li>
</ul>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">string1 = <span class="string">"Lua"</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">"\"字符串 1 是\""</span>,string1)</span><br><span class="line">string2 = <span class="string">'runoob.com'</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">"字符串 2 是"</span>,string2)</span><br><span class="line"></span><br><span class="line">string3 = <span class="string">[["Lua 教程"]]</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">"字符串 3 是"</span>,string3)</span><br></pre></td></tr></table></figure>

<h6 id="字符串操作"><a href="#字符串操作" class="headerlink" title="字符串操作"></a>字符串操作</h6><p><strong>string.format(…)</strong><br>返回一个类似printf的格式化字符串</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&gt; <span class="built_in">string</span>.<span class="built_in">format</span>(<span class="string">"the value is:%d"</span>,<span class="number">4</span>)</span><br><span class="line">the value is:<span class="number">4</span></span><br></pre></td></tr></table></figure>

<p><strong>string.char(arg) 和 string.byte(arg[,int])</strong><br>char 将整型数字转成字符并连接， byte 转换字符为整数值(可以指定某个字符，默认第一个字符)。</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&gt; <span class="built_in">string</span>.<span class="built_in">char</span>(<span class="number">97</span>,<span class="number">98</span>,<span class="number">99</span>,<span class="number">100</span>)</span><br><span class="line">abcd</span><br><span class="line">&gt; <span class="built_in">string</span>.<span class="built_in">byte</span>(<span class="string">"ABCD"</span>,<span class="number">4</span>)</span><br><span class="line"><span class="number">68</span></span><br><span class="line">&gt; <span class="built_in">string</span>.<span class="built_in">byte</span>(<span class="string">"ABCD"</span>)</span><br><span class="line"><span class="number">65</span></span><br><span class="line">&gt;</span><br></pre></td></tr></table></figure>

<p><strong>..</strong><br>链接两个字符串</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&gt; <span class="built_in">print</span>(<span class="string">"www.runoob."</span>..<span class="string">"com"</span>)</span><br><span class="line">www.runoob.com</span><br></pre></td></tr></table></figure>

<h5 id="Lua-数组"><a href="#Lua-数组" class="headerlink" title="Lua 数组"></a>Lua 数组</h5><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">array = &#123;<span class="string">"Lua"</span>, <span class="string">"Tutorial"</span>&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i= <span class="number">0</span>, <span class="number">2</span> <span class="keyword">do</span></span><br><span class="line">   <span class="built_in">print</span>(array[i])</span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<p>输出</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="literal">nil</span></span><br><span class="line">Lua</span><br><span class="line">Tutorial</span><br></pre></td></tr></table></figure>

<p>正如你所看到的，我们可以使用整数索引来访问数组元素，如果知道的索引没有值则返回nil。</p>
<p><strong>在 Lua 索引值是以 1 为起始，但你也可以指定 0 开始。</strong></p>
<h5 id="Lua-迭代器"><a href="#Lua-迭代器" class="headerlink" title="Lua 迭代器"></a>Lua 迭代器</h5><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">array = &#123;<span class="string">"Google"</span>, <span class="string">"Runoob"</span>&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> key,value <span class="keyword">in</span> <span class="built_in">ipairs</span>(array) </span><br><span class="line"><span class="keyword">do</span></span><br><span class="line">   <span class="built_in">print</span>(key, value)</span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<p>输出</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1</span>  Google</span><br><span class="line"><span class="number">2</span>  Runoob</span><br></pre></td></tr></table></figure>

<h5 id="Lua-table-表"><a href="#Lua-table-表" class="headerlink" title="Lua table(表)"></a>Lua table(表)</h5><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 初始化表</span></span><br><span class="line">mytable = &#123;&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">-- 指定值</span></span><br><span class="line">mytable[<span class="number">1</span>]= <span class="string">"Lua"</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-- 移除引用</span></span><br><span class="line">mytable = <span class="literal">nil</span></span><br><span class="line"><span class="comment">-- lua 垃圾回收会释放内存</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-- 简单的 table</span></span><br><span class="line">mytable[<span class="number">1</span>]= <span class="string">"Lua"</span></span><br><span class="line">mytable[<span class="string">"wow"</span>] = <span class="string">"修改前"</span></span><br><span class="line"><span class="built_in">print</span>(<span class="string">"mytable 索引为 1 的元素是 "</span>, mytable[<span class="number">1</span>])</span><br><span class="line"><span class="built_in">print</span>(<span class="string">"mytable 索引为 wow 的元素是 "</span>, mytable[<span class="string">"wow"</span>])</span><br></pre></td></tr></table></figure>

<h5 id="Lua-模块与包"><a href="#Lua-模块与包" class="headerlink" title="Lua 模块与包"></a>Lua 模块与包</h5><h6 id="定义模块"><a href="#定义模块" class="headerlink" title="定义模块"></a>定义模块</h6><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- 文件名为 module.lua</span></span><br><span class="line"><span class="comment">-- 定义一个名为 module 的模块</span></span><br><span class="line">module = &#123;&#125;</span><br><span class="line"> </span><br><span class="line"><span class="comment">-- 定义一个常量</span></span><br><span class="line">module.constant = <span class="string">"这是一个常量"</span></span><br><span class="line"> </span><br><span class="line"><span class="comment">-- 定义一个函数</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">module.func1</span><span class="params">()</span></span></span><br><span class="line">    <span class="built_in">io</span>.<span class="built_in">write</span>(<span class="string">"这是一个公有函数！\n"</span>)</span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">local</span> <span class="function"><span class="keyword">function</span> <span class="title">func2</span><span class="params">()</span></span></span><br><span class="line">    <span class="built_in">print</span>(<span class="string">"这是一个私有函数！"</span>)</span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"> </span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">module.func3</span><span class="params">()</span></span></span><br><span class="line">    func2()</span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"> </span><br><span class="line"><span class="keyword">return</span> module</span><br></pre></td></tr></table></figure>

<h6 id="加载模块"><a href="#加载模块" class="headerlink" title="加载模块"></a>加载模块</h6><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- test_module.lua 文件</span></span><br><span class="line"><span class="comment">-- module 模块为上文提到到 module.lua</span></span><br><span class="line"><span class="built_in">require</span>(<span class="string">"module"</span>)</span><br><span class="line"> </span><br><span class="line"><span class="built_in">print</span>(module.constant)</span><br><span class="line"> </span><br><span class="line">module.func3()</span><br></pre></td></tr></table></figure>

<h6 id="加载C库"><a href="#加载C库" class="headerlink" title="加载C库"></a>加载C库</h6><p>如果加载动态库或者查找初始化函数时出错，loadlib 将返回 nil 和错误信息，使其检测错误然后调用初始化函数</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">local</span> <span class="built_in">path</span> = <span class="string">"/usr/local/lua/lib/libluasocket.so"</span></span><br><span class="line"><span class="comment">-- 或者 path = "C:\\windows\\luasocket.dll"，这是 Window 平台下</span></span><br><span class="line"><span class="keyword">local</span> f = <span class="built_in">assert</span>(<span class="built_in">loadlib</span>(<span class="built_in">path</span>, <span class="string">"luaopen_socket"</span>))</span><br><span class="line">f()  <span class="comment">-- 真正打开库</span></span><br></pre></td></tr></table></figure>

<h4 id="SOME-IP简介"><a href="#SOME-IP简介" class="headerlink" title="SOME/IP简介"></a>SOME/IP简介</h4><p>SOME/IP =  “Scalable service-Oriented middleware over IP” 在IP上，可扩展的面向服务的中间件</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562299432958.png" alt="1562299432958"></p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562299029209.png" alt="1562299029209"></p>
<p>SOME/IP其实是构架在传输层之上的应用层通信协议，它的内容虽然很多很杂，但本质上也就是定义了SOME/IP 包头和数据的内容而已。</p>
<h5 id="SOME-IP-On-Wire-Format"><a href="#SOME-IP-On-Wire-Format" class="headerlink" title="SOME/IP On-Wire Format"></a>SOME/IP On-Wire Format</h5><p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562298780881.png" alt="1562298780881"></p>
<ul>
<li><p>Service ID:    每个服务的唯一标识符</p>
</li>
<li><p>Method ID: 0-32767 用于 methods, 32768-65535 用于 events</p>
</li>
<li><p>Length: 以字节为单位的有效负载长度（也包括下一个ID，表示另外8个字节）</p>
</li>
<li><p>Client ID: 客户端的唯一标识符;必须在整个车辆中独一无二</p>
</li>
<li><p>Session ID: 会话处理的标识符;每次调用递增</p>
</li>
<li><p>Protocol Version: 0x01</p>
</li>
<li><p>Interface Version: 服务接口的主要版本</p>
</li>
<li><p>Message Type: </p>
<ul>
<li><p>REQUEST (0x00) 期待响应请求，即使是空的</p>
</li>
<li><p>REQUEST_NO_RETURN (0x01) 不期待响应请求 </p>
</li>
<li><p>NOTIFICATION (0x02) 事件通知，不需要回复</p>
</li>
<li><p>RESPONSE (0x80) 响应消息</p>
<p>…</p>
</li>
</ul>
</li>
<li><p>Return Code: </p>
<ul>
<li><p>E_OK (0x00)  没有错误</p>
</li>
<li><p>E_NOT_OK (0x01) 有错误</p>
<p>…</p>
</li>
</ul>
</li>
</ul>
<p><strong>NOTIFICATION详解</strong></p>
<p>NOTIFICATION属于事件通知类的服务，首先由client向server订阅服务内容，然后server向client自动发布服务内容。</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562300682790.png" alt="1562300682790"></p>
<p>NOTIFICATION又分为<strong>Event</strong>和<strong>Field</strong> 两类，这两类通知都需要首先使用SOME/IP-SD(Service Discovery)来进行服务订阅，然后才能发布通知。</p>
<p>区别在于，Event是某一时刻的快照，只是事件通知，而Field除了事件通知之外，还具有Getter和Setter的功能，即对信息进行读写的操作。</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562300743413.png" alt="1562300743413"></p>
<h5 id="SOME-IP-Service-discovery-（发现服务）"><a href="#SOME-IP-Service-discovery-（发现服务）" class="headerlink" title="SOME/IP Service discovery （发现服务）"></a>SOME/IP Service discovery （发现服务）</h5><p>SOME/IP-SD提供了两种动态发现服务的机制：</p>
<ul>
<li><p>Offer Service ，由server向网络上的小伙伴告知它所提供的服务；</p>
</li>
<li><p>Find Service ，由client向别人请求可用的服务。</p>
</li>
</ul>
<blockquote>
<p>SOME/IP-SD可以被当作SOME/IP的一种特殊服务，client可以远程调用server提供的服务，或者订阅server发布的内容，那么client是怎么知道server提供哪些服务呢，就是通过SOME/IP-SD来实现服务发现过程的。</p>
<p>它对SOME/IP-SD报文中的Payload进行了定义和实现。而Message ID字段则是固定的<strong>0xFF FF 81 00</strong>。</p>
<p>SOME/IP-SD提供了两种动态发现服务的机制。一种是Offer Service ，由server向网络上的小伙伴告知它所提供的服务；另一种是Find Service ，由client向别人请求可用的服务。</p>
</blockquote>
<h4 id="wireshark-插件开发"><a href="#wireshark-插件开发" class="headerlink" title="wireshark 插件开发"></a>wireshark 插件开发</h4><p>wireshark提供了灵活的插件机制，使用户可以方便地扩展wireshark的功能。插件的功能主要包括，但不限于协议解析器。</p>
<p>可以使用Lua或C语言来编写Wireshark插件，下表对比了这两种方式，绿色背景代表占优的一方。</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562293564841.png" alt="1562293564841"></p>
<h5 id="Wireshark对Lua的支持"><a href="#Wireshark对Lua的支持" class="headerlink" title="Wireshark对Lua的支持"></a>Wireshark对Lua的支持</h5><p>启动wireshark，依次点击“Help”，”About Wireshark“菜单，在打开的对话框中的”Wireshark”标签页上观察版本信息，如果如下图一样显示With Lua，说明此版本支持Lua插件。</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562293578821.png" alt="1562293578821"></p>
<p>然后打开wireshark主目录下的init.lua文件，确保disable_lua的值为false，即开启了lua：</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562293734094.png" alt="1562293734094"></p>
<p>在Wireshark中，可以使用Lua编写以下几种插件：</p>
<ul>
<li><strong>Dissectors</strong> 协议解析器，用于解析报文</li>
<li>*<em>Post-dissectors *</em>后置解析器，在其他解析器之后被调用</li>
<li>*<em>Listeners *</em>监听器，用来收集解析后的信息</li>
</ul>
<p><strong>注意</strong></p>
<ol>
<li><p>wireshark启动时，会调用下图目录中的init.lua，顺序是先调用global目录的，再调用personal目录的。</p>
<p>修改init.lua,追加以下</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">dofile</span>(DATA_DIR..<span class="string">"ipdata.lua"</span>)</span><br></pre></td></tr></table></figure>

</li>
</ol>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562293950521.png" alt="1562293950521"></p>
<ol start="2">
<li>通过命令行参数：<strong>-X lua_script:my.lua</strong>传入的my.lua将会在Init.lua之后被调用。</li>
<li>所有的Lua脚本会在解析器注册过程的最后被调用，而这一过程是在wireshark启动时就发生的，早于报文被读取的时刻</li>
</ol>
<h4 id="Lua插件API简介"><a href="#Lua插件API简介" class="headerlink" title="Lua插件API简介"></a>Lua插件API简介</h4><h5 id="ProtoField"><a href="#ProtoField" class="headerlink" title="ProtoField"></a>ProtoField</h5><p>表示协议字段，一般用于解析字段后往解析树上添加节点。根据字段类型不同，其接口可以分为两大类。</p>
<p><strong>整型</strong>:<br>• ProtoField.{type} (abbr, [name], [desc],[base], [valuestring], [mask])<br>type包括：uint8, uint16, uint24, uint32, uint64, framenum</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">local</span> f_msg_id      = ProtoField.uint32(<span class="string">"someip.messageid"</span>,<span class="string">"MessageID"</span>,base.HEX)</span><br></pre></td></tr></table></figure>

<p><strong>其他类型</strong><br>• ProtoField.{type} (abbr, [name], [desc])<br>type包括：float, double, string, stringz, bytes, bool, ipv4, ipv6, ether,oid, guid</p>
<p>这些接口都会返回一个新的字段对象。方括号内是可选字段，花括号内是可替换的类型字段。</p>
<h5 id="Proto"><a href="#Proto" class="headerlink" title="Proto"></a>Proto</h5><p>表示一个新的Protocol，在Wireshark中Protocol对象有很多用处，解析器是其中主要的一个。主要接口有：</p>
<table>
<thead>
<tr>
<th><strong>接口</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody><tr>
<td>proto:__call (name,desc)</td>
<td>创建Proto对象。name和desc分别是对象的名称和描述，前者可用于过滤器等</td>
</tr>
<tr>
<td>proto.name</td>
<td>get名称</td>
</tr>
<tr>
<td>proto.fields</td>
<td>get/set字段</td>
</tr>
<tr>
<td>proto.prefs</td>
<td>get配置项</td>
</tr>
<tr>
<td>proto.init()</td>
<td>初始化函数，无参数</td>
</tr>
<tr>
<td>proto.dissector(tvb,pinfo,tree)</td>
<td>解析函数，3个参数tvb,pinfo,tree，分别是报文内容，报文信息和解析树结构</td>
</tr>
</tbody></table>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">p_someip = Proto(<span class="string">"IPData"</span>,<span class="string">"SOME/IP"</span>) <span class="comment">-- 创建Proto对象</span></span><br></pre></td></tr></table></figure>

<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pinfo.cols.protocol = p_someip.name <span class="comment">-- 列名为IPData</span></span><br></pre></td></tr></table></figure>

<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">p_someip.fields = &#123;f_msg_id&#125;<span class="comment">-- 定义ProtoField</span></span><br></pre></td></tr></table></figure>

<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- initialization routine</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">p_someip.init</span><span class="params">()</span></span></span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- dissection function</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">p_someip.dissector</span><span class="params">(buf,pinfo,root)</span></span></span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<h5 id="Tvb"><a href="#Tvb" class="headerlink" title="Tvb"></a>Tvb</h5><p>Tvb（Testy Virtual Buffer）表示报文缓存，也就是实际的报文数据，可以通过下面介绍的TvbRange从报文数据中解出信息。主要接口有：</p>
<table>
<thead>
<tr>
<th><strong>接口</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody><tr>
<td>tvb:__tostring()</td>
<td>将报文数据转化为字符串，可用于调试</td>
</tr>
<tr>
<td>tvb:reported_len()</td>
<td>get tvb的(not captured)长度</td>
</tr>
<tr>
<td>tvb:len()</td>
<td>get tvb的(captured)长度</td>
</tr>
<tr>
<td>tvb:reported_length_remaining()</td>
<td>获取当前tvb的剩余长度，如果偏移值大于报文长度，则返回-1</td>
</tr>
<tr>
<td>tvb:offset()</td>
<td>返回原始偏移</td>
</tr>
</tbody></table>
<h5 id="TvbRange"><a href="#TvbRange" class="headerlink" title="TvbRange"></a>TvbRange</h5><p>表示Tvb的可用范围，常用来从Tvb中解出信息。主要接口有</p>
<table>
<thead>
<tr>
<th><strong>接口</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody><tr>
<td>tvb:range([offset], [length])</td>
<td>从tvb创建TvbRange，可选参数分别是偏移和长度，默认值分别是0和总长度</td>
</tr>
<tr>
<td>tvbrange:{type}()</td>
<td>将tvbrange所表示范围内的数据转换成type类型的值，type包括但不限于：uint,uint64,int,int64,float,ipv4,ether,nstime,string,ustring,bytes,bitfield等，其中某些类型的方法可以带一些参数</td>
</tr>
</tbody></table>
<h5 id="Pinfo"><a href="#Pinfo" class="headerlink" title="Pinfo"></a>Pinfo</h5><p>报文信息(packet information)。主要接口有：</p>
<table>
<thead>
<tr>
<th><strong>接口</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody><tr>
<td>pinfo.len pinfo.caplen</td>
<td>get报文长度</td>
</tr>
<tr>
<td>pinfo.abs_ts</td>
<td>get报文捕获时间</td>
</tr>
<tr>
<td>pinfo.number</td>
<td>get报文编号</td>
</tr>
<tr>
<td>pinfo.src pinfo.dst</td>
<td>get/set报文的源地址、目的地址</td>
</tr>
<tr>
<td>pinfo.columns pinfo.cols</td>
<td>get报文列表列（界面）</td>
</tr>
</tbody></table>
<p>取得报文列表列后，就可以设置该列的文本，比如</p>
<p>pinfo.cols.info = “hello world”</p>
<p>将Info列的文本设为hello world。</p>
<h5 id="TreeItem"><a href="#TreeItem" class="headerlink" title="TreeItem"></a>TreeItem</h5><p>表示报文解析树中的一个树节点。主要接口有：</p>
<table>
<thead>
<tr>
<th><strong>接口</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody><tr>
<td>treeitem:add([protofield], [tvbrange], [value], [label])</td>
<td>向当前树节点添加一个子节点</td>
</tr>
<tr>
<td>treeitem:set_text(text)</td>
<td>设置当前树节点的文本</td>
</tr>
<tr>
<td>treeitem:prepend_text(text)</td>
<td>在当前树节点文本的前面加上text</td>
</tr>
<tr>
<td>treeitem:append_text(text)</td>
<td>在当前树节点文本的后面加上text</td>
</tr>
</tbody></table>
<h5 id="DissectorTable"><a href="#DissectorTable" class="headerlink" title="DissectorTable"></a>DissectorTable</h5><p>表示一个具体协议的解析表，比如，协议TCP的解析表”tcp.port”包括http,smtp,ftp等。可以依次点击wireshark菜单“Internals”、“Dissector tables”，来查看当前的所有解析表。tcp.port解析表在“Integer tables”选项卡中，顾名思义，它是通过类型为整型的tcp端口号来识别下游协议的：</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562297940288.png" alt="1562297940288"></p>
<p>DissectorTable的主要接口有：</p>
<table>
<thead>
<tr>
<th><strong>接口</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody><tr>
<td>DissectorTable.get(name)</td>
<td>get名为name的解析表的引用</td>
</tr>
<tr>
<td>dissectortable:add(pattern, dissector)</td>
<td>将Proto或Dissector对象添加到解析表，即注册。pattern可以是整型值，整型值范围或字符串，这取决于当前解析表的类型</td>
</tr>
<tr>
<td>dissectortable:remove(pattern, dissector)</td>
<td>将满足pattern的一个或一组Proto、Dissector对象从解析表中删除</td>
</tr>
</tbody></table>
<h5 id="插件骨架"><a href="#插件骨架" class="headerlink" title="插件骨架"></a>插件骨架</h5><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">-- create a new dissector</span></span><br><span class="line">p_someip = Proto(<span class="string">"IPData"</span>,<span class="string">"SOME/IP"</span>) <span class="comment">-- 创建Proto对象</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-- dissect packet</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">p_someip.dissector</span><span class="params">(buf,pinfo,root)</span></span> <span class="comment">-- 解析协议</span></span><br><span class="line">    </span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-- register this dissector</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">p_someip.init</span><span class="params">()</span></span> <span class="comment">-- 注册解析器</span></span><br><span class="line">    <span class="comment">-- register protocol </span></span><br><span class="line">    <span class="keyword">local</span> udp_dissector_table = DissectorTable.get(<span class="string">"udp.port"</span>)</span><br><span class="line">    <span class="keyword">local</span> tcp_dissector_table = DissectorTable.get(<span class="string">"tcp.port"</span>)</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Register dissector to multiple ports</span></span><br><span class="line">    <span class="keyword">for</span> i,port <span class="keyword">in</span> <span class="built_in">ipairs</span>&#123;<span class="number">55000</span>&#125; <span class="keyword">do</span></span><br><span class="line">        udp_dissector_table:add(port,p_someip)</span><br><span class="line">        tcp_dissector_table:add(port,p_someip)</span><br><span class="line">    <span class="keyword">end</span></span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562302859400.png" alt="1562302859400"></p>
<h5 id="完善骨架中的内容"><a href="#完善骨架中的内容" class="headerlink" title="完善骨架中的内容"></a>完善骨架中的内容</h5><h6 id="定义协议中各个字段的名称"><a href="#定义协议中各个字段的名称" class="headerlink" title="定义协议中各个字段的名称"></a>定义协议中各个字段的名称</h6><figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">local</span> f_msg_id      = ProtoField.uint32(<span class="string">"someip.messageid"</span>,<span class="string">"MessageID"</span>,base.HEX)</span><br><span class="line"><span class="keyword">local</span> f_len         = ProtoField.uint32(<span class="string">"someip.length"</span>,<span class="string">"Length"</span>,base.HEX)</span><br><span class="line"><span class="keyword">local</span> f_req_id      = ProtoField.uint32(<span class="string">"someip.requestid"</span>,<span class="string">"RequestID"</span>,base.HEX)</span><br><span class="line"><span class="keyword">local</span> f_pv          = ProtoField.uint8(<span class="string">"someip.protoversion"</span>,<span class="string">"ProtocolVersion"</span>,base.HEX)</span><br><span class="line"><span class="keyword">local</span> f_iv          = ProtoField.uint8(<span class="string">"someip.ifaceversion"</span>,<span class="string">"InterfaceVersion"</span>,base.HEX)</span><br><span class="line"><span class="keyword">local</span> f_mt          = ProtoField.uint8(<span class="string">"someip.msgtype"</span>,<span class="string">"MessageType"</span>,base.HEX)</span><br><span class="line"><span class="keyword">local</span> f_rc          = ProtoField.uint8(<span class="string">"someip.returncode"</span>,<span class="string">"ReturnCode"</span>,base.HEX)</span><br><span class="line"><span class="keyword">local</span> f_payload		= ProtoField.bytes(<span class="string">"someip.payload"</span>,<span class="string">"Payload"</span>)</span><br><span class="line"></span><br><span class="line">p_someip.fields = &#123;f_msg_id,f_len,f_req_id,f_pv,f_iv,f_mt,f_rc, f_offset, f_reserved, f_more_seg,f_payload&#125;</span><br></pre></td></tr></table></figure>

<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562303216672.png" alt="1562303216672"></p>
<h6 id="过滤消息的方法"><a href="#过滤消息的方法" class="headerlink" title="过滤消息的方法"></a>过滤消息的方法</h6><p>依据 ProtoField.uint32(“<strong>someip.length</strong>“,”Length”,base.HEX)</p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562303573720.png" alt="1562303573720"></p>
<h6 id="解析消息内容"><a href="#解析消息内容" class="headerlink" title="解析消息内容"></a>解析消息内容</h6><p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562315812364.png" alt="1562315812364"></p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">local</span> band,bor = bit.band,bit.bor <span class="comment">-- 与和或</span></span><br><span class="line"><span class="keyword">local</span> lshift, rshift = bit.lshift,bit.rshift <span class="comment">-- 左右移位操作</span></span><br><span class="line"><span class="keyword">local</span> tohex = bit.tohex <span class="comment">-- 转成16进制</span></span><br><span class="line"></span><br><span class="line"><span class="comment">--fields functions</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">field_msgid</span><span class="params">(subtree,buf,pinfo)</span></span></span><br><span class="line">    msg_id = subtree:add(f_msg_id,buf(<span class="number">0</span>,<span class="number">4</span>)) <span class="comment">-- 0开始，4个字节为message id，名称为f_msg_id</span></span><br><span class="line">    <span class="keyword">local</span> msg_id_uint = buf(<span class="number">0</span>,<span class="number">4</span>):uint()     <span class="comment">-- 0开始，4个字节的内容转化为unsigned int</span></span><br><span class="line"></span><br><span class="line">    msg_id:append_text( <span class="string">" ("</span>..tohex(buf(<span class="number">0</span>,<span class="number">2</span>):uint(),<span class="number">4</span>).. </span><br><span class="line">                        <span class="string">":"</span>..band(rshift(msg_id_uint,<span class="number">15</span>),<span class="number">0x01</span>).. <span class="comment">-- 右移15位，与0x01做与操作</span></span><br><span class="line">                        <span class="string">":"</span>..tohex(band(msg_id_uint,<span class="number">0x7fff</span>),<span class="number">4</span>)..<span class="string">")"</span>) <span class="comment">-- 0x7fff做与操作</span></span><br><span class="line">    msg_id:add(<span class="string">"service_id : "</span>..tohex(buf(<span class="number">0</span>,<span class="number">2</span>):uint(),<span class="number">4</span>)) <span class="comment">-- 0开始，2个字节格式化为4位的十六进制</span></span><br><span class="line"><span class="keyword">end</span></span><br><span class="line"></span><br><span class="line"><span class="comment">-- dissection function</span></span><br><span class="line"><span class="function"><span class="keyword">function</span> <span class="title">p_someip.dissector</span><span class="params">(buf,pinfo,root)</span></span></span><br><span class="line">    pinfo.cols.protocol = p_someip.name <span class="comment">-- 消息协议的列为</span></span><br><span class="line">	</span><br><span class="line">    <span class="comment">-- Header Start </span></span><br><span class="line">    subtree = root:add(p_someip,buf(<span class="number">0</span>)) <span class="comment">-- 添加一个节点，名称为SOME/IP</span></span><br><span class="line">	<span class="comment">-- Message ID 32bit</span></span><br><span class="line">    field_msgid(subtree,buf,pinfo) <span class="comment">-- 取32bit，用于Message ID</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Length 32bit</span></span><br><span class="line">    subtree:add(f_len,buf(<span class="number">4</span>,<span class="number">4</span>)) <span class="comment">-- 4字节开始，取4个字节</span></span><br><span class="line">    <span class="comment">-- request  ID 32bit</span></span><br><span class="line">    field_reqid(subtree,buf)</span><br><span class="line">    <span class="comment">-- Protocol Version 8bit</span></span><br><span class="line">    subtree:add(f_pv,buf(<span class="number">12</span>,<span class="number">1</span>))</span><br><span class="line">    <span class="comment">-- Interface Version 8bit</span></span><br><span class="line">    subtree:add(f_iv,buf(<span class="number">13</span>,<span class="number">1</span>))</span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Message type 8bit</span></span><br><span class="line">    <span class="keyword">local</span> <span class="built_in">type</span> = subtree:add(f_mt,buf(<span class="number">14</span>,<span class="number">1</span>))</span><br><span class="line">    <span class="keyword">if</span> msg_types[buf(<span class="number">14</span>,<span class="number">1</span>):uint()] ~= <span class="literal">nil</span> <span class="keyword">then</span></span><br><span class="line">        <span class="built_in">type</span>:append_text(<span class="string">" ("</span> .. msg_types[buf(<span class="number">14</span>,<span class="number">1</span>):uint()] ..<span class="string">")"</span>)</span><br><span class="line">    <span class="keyword">end</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- Return Code 8bit</span></span><br><span class="line">    <span class="keyword">local</span> rcode = subtree:add(f_rc,buf(<span class="number">15</span>,<span class="number">1</span>))</span><br><span class="line">    <span class="keyword">if</span> ret_codes[buf(<span class="number">15</span>,<span class="number">1</span>):uint()] ~= <span class="literal">nil</span> <span class="keyword">then</span></span><br><span class="line">        rcode:append_text(<span class="string">" ("</span> .. ret_codes[buf(<span class="number">15</span>,<span class="number">1</span>):uint()] ..<span class="string">")"</span>)</span><br><span class="line">    <span class="keyword">end</span></span><br><span class="line">	<span class="comment">-- Header End</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">-- SD payload --</span></span><br><span class="line">    </span><br><span class="line">    <span class="keyword">if</span> (buf(<span class="number">0</span>,<span class="number">4</span>):uint() == <span class="number">0xffff8100</span>) <span class="keyword">and</span> (buf:<span class="built_in">len</span>() &gt; SOMEIP_SD_OFFSET)  <span class="keyword">then</span></span><br><span class="line">        Dissector.get(<span class="string">"sd"</span>):call(buf(SOMEIP_SD_OFFSET):tvb(),pinfo,root) <span class="comment">-- 调用另外一个sd.lua文件，把buf(SOMEIP_SD_OFFSET)后的数据，传给sd.lua的dissector</span></span><br><span class="line">    <span class="keyword">end</span></span><br><span class="line">    </span><br><span class="line"><span class="keyword">end</span></span><br></pre></td></tr></table></figure>

<h4 id="调试"><a href="#调试" class="headerlink" title="调试"></a>调试</h4><p>在代码中加入</p>
<figure class="highlight lua"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">debug</span>(elementName)</span><br></pre></td></tr></table></figure>

<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562546595082.png" alt="1562546595082"></p>
<p><img src="/2019/07/05/wireshark插件开发之vsomeip协议/1562546622875.png" alt="1562546622875"></p>

    </div>

    
    
    
        
      

      <footer class="post-footer">
          
            
          
          <div class="post-tags">
            
              <a href="/tags/wireshark-vsomeip-lua/" rel="tag"># wireshark,vsomeip,lua</a>
            
          </div>
        

        

          <div class="post-nav">
            <div class="post-nav-next post-nav-item">
              
                <a href="/2019/07/04/鱼骨图分析法/" rel="next" title="鱼骨图分析法">
                  <i class="fa fa-chevron-left"></i> 鱼骨图分析法
                </a>
              
            </div>

            <span class="post-nav-divider"></span>

            <div class="post-nav-prev post-nav-item">
              
                <a href="/2019/07/05/C-V2X白皮书/" rel="prev" title="C-V2X白皮书">
                  C-V2X白皮书 <i class="fa fa-chevron-right"></i>
                </a>
              
            </div>
          </div>
        
      </footer>
    
  </div>
  
  
  
  </article>

  </div>


          </div>
          

        </div>
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">XuQi</p>
  <div class="site-description motion-element" itemprop="description"></div>
</div>
  <nav class="site-state motion-element">
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">44</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    
      
      
      <div class="site-state-item site-state-tags">
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">30</span>
        <span class="site-state-item-name">标签</span>
        
      </div>
    
  </nav>



        </div>
      </div>
      <!--noindex-->
        <div class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
            
            
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#wireshark插件开发之vsomeip协议"><span class="nav-number">1.</span> <span class="nav-text">wireshark插件开发之vsomeip协议</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Lua语法介绍"><span class="nav-number">1.0.1.</span> <span class="nav-text">Lua语法介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-数据类型"><span class="nav-number">1.0.1.1.</span> <span class="nav-text">Lua 数据类型</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-变量"><span class="nav-number">1.0.1.2.</span> <span class="nav-text">Lua 变量</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#单行注释"><span class="nav-number">1.0.1.2.1.</span> <span class="nav-text">单行注释</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#多行注释"><span class="nav-number">1.0.1.2.2.</span> <span class="nav-text">多行注释</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#变量定义和赋值"><span class="nav-number">1.0.1.2.3.</span> <span class="nav-text">变量定义和赋值</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua循环"><span class="nav-number">1.0.1.3.</span> <span class="nav-text">Lua循环</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-流程控制"><span class="nav-number">1.0.1.4.</span> <span class="nav-text">Lua 流程控制</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-函数"><span class="nav-number">1.0.1.5.</span> <span class="nav-text">Lua 函数</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-字符串"><span class="nav-number">1.0.1.6.</span> <span class="nav-text">Lua 字符串</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#字符串操作"><span class="nav-number">1.0.1.6.1.</span> <span class="nav-text">字符串操作</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-数组"><span class="nav-number">1.0.1.7.</span> <span class="nav-text">Lua 数组</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-迭代器"><span class="nav-number">1.0.1.8.</span> <span class="nav-text">Lua 迭代器</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-table-表"><span class="nav-number">1.0.1.9.</span> <span class="nav-text">Lua table(表)</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Lua-模块与包"><span class="nav-number">1.0.1.10.</span> <span class="nav-text">Lua 模块与包</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#定义模块"><span class="nav-number">1.0.1.10.1.</span> <span class="nav-text">定义模块</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#加载模块"><span class="nav-number">1.0.1.10.2.</span> <span class="nav-text">加载模块</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#加载C库"><span class="nav-number">1.0.1.10.3.</span> <span class="nav-text">加载C库</span></a></li></ol></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#SOME-IP简介"><span class="nav-number">1.0.2.</span> <span class="nav-text">SOME/IP简介</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#SOME-IP-On-Wire-Format"><span class="nav-number">1.0.2.1.</span> <span class="nav-text">SOME/IP On-Wire Format</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#SOME-IP-Service-discovery-（发现服务）"><span class="nav-number">1.0.2.2.</span> <span class="nav-text">SOME/IP Service discovery （发现服务）</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#wireshark-插件开发"><span class="nav-number">1.0.3.</span> <span class="nav-text">wireshark 插件开发</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Wireshark对Lua的支持"><span class="nav-number">1.0.3.1.</span> <span class="nav-text">Wireshark对Lua的支持</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Lua插件API简介"><span class="nav-number">1.0.4.</span> <span class="nav-text">Lua插件API简介</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#ProtoField"><span class="nav-number">1.0.4.1.</span> <span class="nav-text">ProtoField</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Proto"><span class="nav-number">1.0.4.2.</span> <span class="nav-text">Proto</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Tvb"><span class="nav-number">1.0.4.3.</span> <span class="nav-text">Tvb</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#TvbRange"><span class="nav-number">1.0.4.4.</span> <span class="nav-text">TvbRange</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Pinfo"><span class="nav-number">1.0.4.5.</span> <span class="nav-text">Pinfo</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#TreeItem"><span class="nav-number">1.0.4.6.</span> <span class="nav-text">TreeItem</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#DissectorTable"><span class="nav-number">1.0.4.7.</span> <span class="nav-text">DissectorTable</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#插件骨架"><span class="nav-number">1.0.4.8.</span> <span class="nav-text">插件骨架</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#完善骨架中的内容"><span class="nav-number">1.0.4.9.</span> <span class="nav-text">完善骨架中的内容</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#定义协议中各个字段的名称"><span class="nav-number">1.0.4.9.1.</span> <span class="nav-text">定义协议中各个字段的名称</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#过滤消息的方法"><span class="nav-number">1.0.4.9.2.</span> <span class="nav-text">过滤消息的方法</span></a></li><li class="nav-item nav-level-6"><a class="nav-link" href="#解析消息内容"><span class="nav-number">1.0.4.9.3.</span> <span class="nav-text">解析消息内容</span></a></li></ol></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#调试"><span class="nav-number">1.0.5.</span> <span class="nav-text">调试</span></a></li></ol></li></ol></li></ol></div>
            

          </div>
        </div>
      <!--/noindex-->
      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">XuQi</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> v7.3.0</div>

        








        
      </div>
    </footer>
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
      </div>

    

  </div>

  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

<script src="/js/utils.js?v=7.3.0"></script>
  <script src="/js/motion.js?v=7.3.0"></script>


  <script src="/js/schemes/muse.js?v=7.3.0"></script>


<script src="/js/next-boot.js?v=7.3.0"></script>




  




























  

  

  


  
  <script src="/js/scrollspy.js?v=7.3.0"></script>
<script src="/js/post-details.js?v=7.3.0"></script>


</body>
</html>
